package mutithread;

/**
 * @author tongchen
 * @create 2023-01-03 17:07
 */
public class Exer01 {
    public static void main(String[] args) {
        //
        Thread t2=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程run03。。。。。。");
            }
        });
        Thread t3=new Thread(() ->System.out.println("线程4"));
        Thread t4=new Thread(()->{
            System.out.println("线程5");
        });

        Thread t1=new Thread(){
            @Override
            public void run() {
                while(true){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    System.out.println("run......线程2");
                }
            }
        };
        MyThread myThread = new MyThread();
        myThread.start();
        t1.start();
        while(true){
            System.out.println("线程1");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
